import { request } from "../../utils/request";
import { ElMessage } from "element-plus";
import useUserStore from "../../store/user";
import { formatUTCTime } from '@/constant/date'
// 获取传感器折线图数据
export const reqMonitorData = async (operationId, startTime, endTime, isPredict) => {
  return request({
    url: 'api/lab/admin/v1/monitor-data/query',
    method: 'get',
    params: {
      id: operationId,
      startTime: startTime,
      endTime: endTime,
      isPredict: isPredict
    }
  })
}


// 获取传感器组数据
export const reqMonitorRecentData = async (operationId) => {
  return request({
    url: 'api/lab/admin/v1/monitor-data/query/recent',
    method: 'get',
    params: {
      operationId: operationId
    }
  })
}

// 获取传感器平均数据
export const reqMonitorAverageData = async (operationId) => {
  return request({
    url: '/api/lab/admin/v1/monitor-data/query/indicators',
    method: 'get',
    params: {
      operationId: operationId
    }
  })
}

// 获取给定时间段内传感器数据
export const reqMonitorDuringTimeData = async (operationId, startTime, endTime) => {
  return request({
    url: 'api/lab/admin/v1/monitor-data/query/duringTime',
    method: 'get',
    params: {
      operationId: operationId,
      startTime: startTime,
      endTime: endTime
    }
  })
}